package com.sap.health.tracker.graph;

import java.util.Vector;

import com.androidplot.series.XYSeries;

/*
 * Holds the variable for the Graph.
 */
public class GraphHolder implements XYSeries { 
	Vector<Double> data;

	public GraphHolder(Vector<Double> data){
		update(data);
	}
	public void update(Vector<Double> data){
		this.data=data;
	}
	@Override
    public Number getX(int index) {		
        return data.get(index*2);
    }
    @Override
    public String getTitle() {
        return "";
    } 
    @Override
    public int size() {
        return data.size()/2;
    }
    @Override
    public Number getY(int index) {        
        return data.get(index*2+1);
    }
  }